import region from '@/views/common/regionEdit'

export default function createAddSchema(api, canAccessSuperData){
    return {
        type: 'form',
        title: '',
        mode: 'horizontal',
        actions: [],
        wrapWithPanel: false,
        canAccessSuperData: canAccessSuperData,
        messages:{
            validateFailed:''
        },
        api: api,
        body:[
        {
            type: 'input-text',
            name: 'orgName',
            label: '医疗机构名称',
            maxLength: 200,
            required: true,
            validationErrors: {
                isRequired: '请输入医疗机构名称'
            }
        },
        {
            type: 'group',
            body:[
                {
                    type: 'select',
                    name: 'nhsaId',
                    label: '所属医保局',
                    autoComplete: '/upms/admin/org/nhsa/select?orgName=${term}&selectedId=${nhsaId}',
                    placeholder: '请选择所属医保局',
                    required: true,
                    validationErrors: {
                        isRequired: '请选择所属医保局'
                    }
                },
                {
                    type: 'input-text',
                    name: 'orgCode',
                    label: '编码',
                    maxLength: 20,
                }
            ]
        },
        {
            type: 'group',
            body:[
                {
                    type: 'select',
                    name: 'quality',
                    label: '性质',
                    source: '/base/dict/options/hosp-quality',
                },
                {
                    type: 'select',
                    name: 'grade',
                    label: '等级',
                    source: '/base/dict/options/hosp-grade',
                },
                {
                    type: 'select',
                    name: 'level',
                    label: '等次',
                    source: '/base/dict/options/hosp-level',
                },
            ]
        },
        region,
        {
            type: 'group',
            body:[
                {
                    type: 'input-text',
                    name: 'contactName',
                    label: '联系人',
                    maxLength: 50,
                },
                {
                    type: 'input-text',
                    name: 'contactPhone',
                    label: '联系电话',
                    maxLength: 20,
                }
            ]
        },
        {
            type: 'hidden',
            name: 'id'
        }]
    }
}